Skip to content

[WIP] [#1911] Add bag concept - #1926

Open
elBoberido wants to merge 3 commits into
eclipse-iceoryx:mainfrom
ekxide:iox2-1911-add-dynamic-config-container-concept
Open

[WIP] [#1911] Add bag concept#1926
elBoberido wants to merge 3 commits into
eclipse-iceoryx:mainfrom
ekxide:iox2-1911-add-dynamic-config-container-concept

Conversation

@elBoberido

Copy link
Copy Markdown
Member

Notes for Reviewer

Pre-Review Checklist for the PR Author

  • Add sensible notes for the reviewer
  • PR title is short, expressive and meaningful
  • Consider switching the PR to a draft (Convert to draft)
    • as draft PR, the CI will be skipped for pushes
  • Relevant issues are linked in the References section
  • Branch follows the naming format (iox2-123-introduce-posix-ipc-example)
  • Commits messages are according to this guideline
    • Commit messages have the issue ID ([#123] Add posix ipc example)
    • Keep in mind to use the same email that was used to sign the Eclipse Contributor Agreement
  • Tests follow the best practice for testing
  • Changelog updated in the unreleased section including API breaking changes

PR Reviewer Reminders

  • Commits are properly organized and messages are according to the guideline
  • Unit tests have been written for new behavior
  • Public API is documented
  • PR title describes the changes

References

Closes #1911

@elBoberido
elBoberido force-pushed the iox2-1911-add-dynamic-config-container-concept branch from aaf7d2f to c568d17 Compare August 20, 2026 01:05

@elfenpiff elfenpiff left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good - except the hardest part, the naming ;) .

Comment thread iceoryx2-cal/src/bag/default_bag.rs Outdated
unsafe { self.remove(handle, mode) }
}

unsafe fn get_state(&self) -> ContainerState<T> {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we rename the ContainerState to BagState?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was also thinking about re-exporting all the types from iceoryx2-bb-lock-free in the iceoryx2-cal/bag namespace. Not sure about changing also the iceoryx2-bb-lock-free Container itself right now.

Comment thread iceoryx2-cal/src/bag/default_bag.rs Outdated

unsafe fn remove(
&self,
handle: ContainerHandle,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we rename the ContainerHandle to BagHandle

Comment thread iceoryx2-cal/src/bag/mod.rs Outdated
impl<T: Copy + Debug + ZeroCopySend> BagValue for T {}

/// TODO documentation
pub trait Bag: Debug + 'static {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we rename this: Bag -> BagFamily and the BagAccess is Bag.

The thinking is, that a Bag is a thing that contains T and has the following interface and behavior. But with this is a Bag a trait that defines a type alias and BagAccess is the thing that contains T.

We already have this name scheme in place in iceoryx2. We have for instance a Pointer<T> trait: https://github.com/eclipse-iceoryx/iceoryx2/blob/main/iceoryx2-bb/elementary-traits/src/pointer.rs
and a PointerFamily trait: https://github.com/eclipse-iceoryx/iceoryx2/blob/main/iceoryx2-bb/elementary-traits/src/pointer_family.rs

This reads then in code naturally:

struct SomeThing<P: Pointer> {
  fuu: P<u64>
}

or when you need it more generic:

struct SomeThing<P: PointerFamily> {
  fuu: P::Pointer<u64>,
  bar: P::Pointer<i32>
}

I think I had some discussion with ?Jeff? and a LLM until come to this naming style.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point

Comment thread iceoryx2-cal/src/bag/default_bag.rs Outdated
&self,
value: T,
owner_id: OwnerId,
) -> Result<(*const T, ContainerHandle), ContainerAddFailure> {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we rename all errors to BagAddFailure etc..

Comment thread iceoryx2-cal/src/bag/mod.rs Outdated

/// TODO documentation
pub trait Bag: Debug + 'static {
type Container<T: BagValue>: Debug

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This we could rename to Bag and technically T would be the BagType.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to prevent misunderstanding. This is your suggestion, right

pub trait BagFamily: Debug + 'static {
    type Bag<T: BagType>: Debug

@elBoberido
elBoberido force-pushed the iox2-1911-add-dynamic-config-container-concept branch 2 times, most recently from f1357c6 to 04a8510 Compare August 20, 2026 14:13
Ok(ReleaseState::Unlocked) => Ok(DeregisterNodeState::HasOwners),
Err(ContainerRemoveError::ContainerHandleNotOwnedByContainer) => {
fail!(from self, with ContainerRemoveError::ContainerHandleNotOwnedByContainer,
Err(BagRemoveError::ContainerHandleNotOwnedByContainer) => {

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@elfenpiff this is not nice. We either have to create a BagRemoveError enum and map the errors 1-1 to ContainerRemoveError or rename the error e.g. to HandleNotOwnedByContainer which is a bit less confusing. The former option would add some boilerplate. Alternatively, the Container itself could be renamed.

@codecov

codecov Bot commented Aug 20, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.51553% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 76.35%. Comparing base (b9a46eb) to head (c79a037).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
iceoryx2-cal/src/bag/default_bag.rs 91.89% 3 Missing ⚠️
iceoryx2/src/service/dynamic_config/mod.rs 90.90% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1926      +/-   ##
==========================================
+ Coverage   76.33%   76.35%   +0.02%     
==========================================
  Files         457      458       +1     
  Lines       46068    46112      +44     
  Branches     1489     1489              
==========================================
+ Hits        35165    35210      +45     
+ Misses       9641     9640       -1     
  Partials     1262     1262              
Flag Coverage Δ
CPP 62.61% <ø> (ø)
Rust 76.21% <97.51%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...ceoryx2-bb/elementary-traits/src/zero_copy_send.rs 85.71% <ø> (ø)
iceoryx2/src/node/mod.rs 65.97% <100.00%> (ø)
iceoryx2/src/port/client.rs 92.99% <100.00%> (ø)
iceoryx2/src/port/listener.rs 90.47% <100.00%> (+0.15%) ⬆️
iceoryx2/src/port/notifier.rs 86.84% <100.00%> (ø)
iceoryx2/src/port/publisher.rs 92.32% <100.00%> (ø)
iceoryx2/src/port/reader.rs 87.55% <100.00%> (+0.10%) ⬆️
iceoryx2/src/port/server.rs 92.96% <100.00%> (ø)
iceoryx2/src/port/subscriber.rs 93.66% <100.00%> (ø)
iceoryx2/src/port/writer.rs 92.33% <100.00%> (+0.05%) ⬆️
... and 18 more

... and 6 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@elBoberido
elBoberido force-pushed the iox2-1911-add-dynamic-config-container-concept branch from 04a8510 to b08d3f4 Compare August 20, 2026 14:48
@elBoberido
elBoberido force-pushed the iox2-1911-add-dynamic-config-container-concept branch from b08d3f4 to c79a037 Compare August 21, 2026 15:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DynamicConfigContainer concept

2 participants